package com.example.prison.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.prison.entity.CarTrafficRecord;
import com.example.prison.service.CarTrafficRecordService;
import com.example.prison.mapper.CarTrafficRecordMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author jiang
* @description 针对表【car_traffic_record】的数据库操作Service实现
* @createDate 2024-06-03 11:33:54
*/
@Service
public class CarTrafficRecordServiceImpl extends ServiceImpl<CarTrafficRecordMapper, CarTrafficRecord>
    implements CarTrafficRecordService{

    @Autowired
    private CarTrafficRecordMapper carTrafficRecordMapper;

    @Override
    public PageInfo<CarTrafficRecord> get(int pageNumber, int pageSize, String number, String beginDate, String endDate) {
        PageHelper.startPage(pageNumber, pageSize);
        return new PageInfo<>(carTrafficRecordMapper.get(number,beginDate,endDate));
    }

    @Override
    public int add(CarTrafficRecord record) {
        carTrafficRecordMapper.add(record);
        return 1;
    }

    @Override
    public void delete(Integer[] ids) {
        carTrafficRecordMapper.deleting(ids);
    }

    @Override
    public CarTrafficRecord getById(Integer id) {
        return carTrafficRecordMapper.getById(id);
    }


}




